import java.util.Arrays;

public class test {
    public static int[] second(int[] array){
        for (int i = 0; i <array.length ; i++) {
            array[i] = array[i] * 2;
        }
        return array;
    }
    public static void main3(String[] args) {
        int[] array = {1,2,3,4,5};
        int[] ret = second(array);
        System.out.println(Arrays.toString(ret));
    }
    //冒泡排序
    public static void bubbleSort(int[] array){
        for (int i = 0; i <array.length-1 ; i++) {
            boolean flg = false;
            for (int j = 0; j <array.length-1-i; j++) {
                if(array[j] > array[j+1]){
                    int tmp = array[i];
                    array[j] = array[j+1];
                    flg = true;
                }
            }
            if(flg = false){
                break;
            }
        }
    }
    public static void main(String[] args) {

    }
    //数组拷贝
    public static void main1(String[] args) {
        int[] array = {1,2,3,4,5};
        int[] copy = new int[array.length];
        for (int i = 0; i <array.length ; i++) {
            copy[i] = array[i];
        }
        for (int i = 0; i <copy.length ; i++) {
            System.out.println(copy[i]);
        }
    }
}
